﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PresentationLayer.Reports;



namespace PresentationLayer.View.Reports
{
    public partial class Print_TrendByCategory : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            int m1 =Convert.ToInt32(Request.QueryString["m1"].ToString());
            //string m2 = Request.QueryString["m2"].ToString();
            //string m3 = Request.QueryString["m3"].ToString();
            string cat = Request.QueryString["cat"].ToString();

            DS_Category ds = new DS_Category();
            PresentationLayer.Reports.DS_CategoryTableAdapters.CategoryTableAdapter ta = new PresentationLayer.Reports.DS_CategoryTableAdapters.CategoryTableAdapter();
              if (m1 == 01)
            {
                ta.FillByJan(ds.Category,cat);
                PresentationLayer.Reports.Report_TrendAnalysisByCategory req = new PresentationLayer.Reports.Report_TrendAnalysisByCategory();
                req.SetDataSource(ds);
                CrystalReportViewer9.ReportSource = req;

            }
            if (m1 == 02)
            {
                ta.FillByfeb(ds.Category, cat);
                PresentationLayer.Reports.Report_TrendAnalysisByCategory req = new PresentationLayer.Reports.Report_TrendAnalysisByCategory();
                req.SetDataSource(ds);
                CrystalReportViewer9.ReportSource = req;

            }
            else 
            {
                ta.FillByALL(ds.Category, m1, cat);
                PresentationLayer.Reports.Report_TrendAnalysisByCategory req = new PresentationLayer.Reports.Report_TrendAnalysisByCategory();
                req.SetDataSource(ds);
                CrystalReportViewer9.ReportSource = req;
            
            }
        }

      
        


    }
}